<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>基于Netty+WebSocket简易版微信 | Joey</title><meta name="keywords" content="Java,SpringBoot,netty"><meta name="author" content="方陈勇"><meta name="copyright" content="方陈勇"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="仿微信">
<meta property="og:type" content="article">
<meta property="og:title" content="基于Netty+WebSocket简易版微信">
<meta property="og:url" content="https://fangchenyong.top/2019/08/23/%E9%A1%B9%E7%9B%AE-%E5%9F%BA%E4%BA%8ENetty+WebSocket%E7%AE%80%E6%98%93%E7%89%88%E5%BE%AE%E4%BF%A1/index.html">
<meta property="og:site_name" content="Joey">
<meta property="og:description" content="仿微信">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG">
<meta property="article:published_time" content="2019-08-23T14:12:23.000Z">
<meta property="article:modified_time" content="2020-05-22T10:06:08.952Z">
<meta property="article:author" content="方陈勇">
<meta property="article:tag" content="Java">
<meta property="article:tag" content="SpringBoot">
<meta property="article:tag" content="netty">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://fangchenyong.top/2019/08/23/%E9%A1%B9%E7%9B%AE-%E5%9F%BA%E4%BA%8ENetty+WebSocket%E7%AE%80%E6%98%93%E7%89%88%E5%BE%AE%E4%BF%A1/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2020-05-22 18:06:08'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/3FD9B055-6361-49B7-B8CE-5BA9144BD27F.JPG" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">43</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">51</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">53</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Joey</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">基于Netty+WebSocket简易版微信</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-08-23T14:12:23.000Z" title="发表于 2019-08-23 22:12:23">2019-08-23</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-05-22T10:06:08.952Z" title="更新于 2020-05-22 18:06:08">2020-05-22</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Java/">Java</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Java/SpringBoot/">SpringBoot</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Java/SpringBoot/netty/">netty</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">695</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>3分钟</span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="基于Netty-WebSocket简易版微信-慕课网"><a href="#基于Netty-WebSocket简易版微信-慕课网" class="headerlink" title="基于Netty+WebSocket简易版微信-慕课网"></a>基于Netty+WebSocket简易版微信-慕课网</h1><h3 id="1-技术栈"><a href="#1-技术栈" class="headerlink" title="1. 技术栈"></a>1. 技术栈</h3><p><strong>前端：MUI 、H5PLUS</strong></p>
<p><strong>后端：SpringBoot 、Netty、WebSocket、Mysql、FastDFS、Nginx、Mybatis</strong></p>
<h3 id="2-数据库建表"><a href="#2-数据库建表" class="headerlink" title="2. 数据库建表"></a>2. 数据库建表</h3><h4 id="表：users"><a href="#表：users" class="headerlink" title="表：users"></a>表：users</h4><table>
<thead>
<tr>
<th>表名</th>
<th align="left">users</th>
<th>表名中文</th>
<th>用户表</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>No</td>
<td align="left">列名</td>
<td>列名中文</td>
<td>类型</td>
<td>长度</td>
<td>Key</td>
<td>Null</td>
<td>默认值</td>
<td>备注</td>
</tr>
<tr>
<td>1</td>
<td align="left">id</td>
<td>主键</td>
<td>varchar</td>
<td>64</td>
<td>Y</td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td align="left">username</td>
<td>名称</td>
<td>varchar</td>
<td>20</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td align="left">password</td>
<td>密码</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>M</td>
<td></td>
<td></td>
</tr>
<tr>
<td>4</td>
<td align="left">face_image</td>
<td>头像</td>
<td>varchar</td>
<td>255</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>5</td>
<td align="left">face_image_big</td>
<td>大头像</td>
<td>varchar</td>
<td>255</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>6</td>
<td align="left">nickname</td>
<td>昵称</td>
<td>varchar</td>
<td>20</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>7</td>
<td align="left">qrcode</td>
<td>二维码</td>
<td>varchar</td>
<td>255</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>8</td>
<td align="left">cid</td>
<td>设备ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<h4 id="表：friends-request"><a href="#表：friends-request" class="headerlink" title="表：friends_request"></a>表：friends_request</h4><table>
<thead>
<tr>
<th>表名</th>
<th>friends_request</th>
<th>表名中文</th>
<th>用户请求表</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>No</td>
<td>列名</td>
<td>列名中文</td>
<td>类型</td>
<td>长度</td>
<td>Key</td>
<td>Null</td>
<td>默认值</td>
<td>备注</td>
</tr>
<tr>
<td>1</td>
<td>id</td>
<td>主键</td>
<td>varchar</td>
<td>64</td>
<td>Y</td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>send_user_id</td>
<td>发送者ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>accept_user_id</td>
<td>接收者ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>4</td>
<td>request_date_time</td>
<td>接收时间</td>
<td>datetime</td>
<td>0</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<h4 id="表：my-friends"><a href="#表：my-friends" class="headerlink" title="表：my_friends"></a>表：my_friends</h4><table>
<thead>
<tr>
<th>表名</th>
<th>my_friends</th>
<th>表名中文</th>
<th>好友中间表</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>No</td>
<td>列名</td>
<td>列名中文</td>
<td>类型</td>
<td>长度</td>
<td>Key</td>
<td>Null</td>
<td>默认值</td>
<td>备注</td>
</tr>
<tr>
<td>1</td>
<td>id</td>
<td>主键</td>
<td>varchar</td>
<td>64</td>
<td>Y</td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>my_user_id</td>
<td>我的ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>my_friend_user_id</td>
<td>好友的ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<h4 id="表：chat-msg"><a href="#表：chat-msg" class="headerlink" title="表：chat_msg"></a>表：chat_msg</h4><table>
<thead>
<tr>
<th>表名</th>
<th>chat_msg</th>
<th>表名中文</th>
<th>好友中间表</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>No</td>
<td>列名</td>
<td>列名中文</td>
<td>类型</td>
<td>长度</td>
<td>Key</td>
<td>Null</td>
<td>默认值</td>
<td>备注</td>
</tr>
<tr>
<td>1</td>
<td>id</td>
<td>主键</td>
<td>varchar</td>
<td>64</td>
<td>Y</td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>send_user_id</td>
<td>我的ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>accept_user_id</td>
<td>好友的ID</td>
<td>varchar</td>
<td>64</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>4</td>
<td>msg</td>
<td>消息</td>
<td>varchar</td>
<td>255</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>sign_flag</td>
<td>已读未读</td>
<td>int</td>
<td>1</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>create_time</td>
<td>发送时间</td>
<td>datetime</td>
<td>0</td>
<td></td>
<td>N</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<figure class="highlight sql"><table><tr><td class="code"><pre><span class="line"><span class="keyword">create</span> <span class="keyword">TABLE</span> <span class="keyword">user</span>(</span><br><span class="line">	id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">not</span> <span class="keyword">null</span> COMMENT <span class="string">&#x27;主键&#x27;</span>,</span><br><span class="line">	username <span class="type">varchar</span>(<span class="number">20</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;名称&#x27;</span>,</span><br><span class="line">	password <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;密码&#x27;</span>,</span><br><span class="line">	face_image <span class="type">varchar</span>(<span class="number">255</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;头像&#x27;</span>,</span><br><span class="line">	face_image_big  <span class="type">varchar</span>(<span class="number">255</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;大头像&#x27;</span>,</span><br><span class="line">	nickname <span class="type">varchar</span>(<span class="number">20</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;昵称&#x27;</span>,</span><br><span class="line">	qrcode <span class="type">varchar</span>(<span class="number">255</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;二维码&#x27;</span>,</span><br><span class="line">	cid <span class="type">VARCHAR</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;设备ID&#x27;</span>,</span><br><span class="line">	<span class="keyword">PRIMARY</span> KEY(id)</span><br><span class="line">)ENGINE<span class="operator">=</span>INNODB <span class="keyword">DEFAULT</span> CHARSET<span class="operator">=</span>utf8;</span><br><span class="line"><span class="keyword">create</span> <span class="keyword">TABLE</span> friends_request(</span><br><span class="line">	id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">not</span> <span class="keyword">null</span> COMMENT <span class="string">&#x27;主键&#x27;</span>,</span><br><span class="line">	send_user_id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;发送者ID&#x27;</span>,</span><br><span class="line">	accept_user_id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;接收者ID&#x27;</span>,</span><br><span class="line">	request_date_time datetime  <span class="keyword">null</span> COMMENT <span class="string">&#x27;接收时间&#x27;</span>,</span><br><span class="line">	<span class="keyword">PRIMARY</span> KEY(id)</span><br><span class="line">)ENGINE<span class="operator">=</span>INNODB <span class="keyword">DEFAULT</span> CHARSET<span class="operator">=</span>utf8;</span><br><span class="line"><span class="keyword">create</span> <span class="keyword">TABLE</span> my_friends(</span><br><span class="line">	id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">not</span> <span class="keyword">null</span> COMMENT <span class="string">&#x27;主键&#x27;</span>,</span><br><span class="line">	my_user_id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;我的ID&#x27;</span>,</span><br><span class="line">	my_friend_user_id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;好友的ID&#x27;</span>,</span><br><span class="line">	<span class="keyword">PRIMARY</span> KEY(id)</span><br><span class="line">)ENGINE<span class="operator">=</span>INNODB <span class="keyword">DEFAULT</span> CHARSET<span class="operator">=</span>utf8;</span><br><span class="line"><span class="keyword">create</span> <span class="keyword">TABLE</span> chat_msg(</span><br><span class="line">	id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">not</span> <span class="keyword">null</span> COMMENT <span class="string">&#x27;主键&#x27;</span>,</span><br><span class="line">	send_user_id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;我的ID&#x27;</span>,</span><br><span class="line">	accept_user_id <span class="type">varchar</span>(<span class="number">64</span>)  <span class="keyword">null</span> COMMENT <span class="string">&#x27;好友的ID&#x27;</span>,</span><br><span class="line">	msg <span class="type">varchar</span>(<span class="number">255</span>)   <span class="keyword">null</span> COMMENT <span class="string">&#x27;消息&#x27;</span>,</span><br><span class="line">    sign_flag <span class="type">int</span> <span class="keyword">null</span> COMMENT <span class="string">&#x27;已读未读&#x27;</span>,</span><br><span class="line">    create_time datetime  <span class="keyword">null</span> COMMENT <span class="string">&#x27;发送时间&#x27;</span>,</span><br><span class="line">	<span class="keyword">PRIMARY</span> KEY(id)</span><br><span class="line">)ENGINE<span class="operator">=</span>INNODB <span class="keyword">DEFAULT</span> CHARSET<span class="operator">=</span>utf8;</span><br></pre></td></tr></table></figure>

<h3 id="问题解决记录"><a href="#问题解决记录" class="headerlink" title="问题解决记录"></a>问题解决记录</h3><ul>
<li><a href="https://fangchenyong.top/2019/08/14/install_FastDFS+Nginx/">安装fastDFS+nginx实现文件存储服务器</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/svneclipse/article/details/80719480">The type org.springframework.context.ConfigurableApplicationContext cannot be resolved.</a></li>
<li><a target="_blank" rel="noopener" href="https://www.iteye.com/blog/1615714">Spring配置事务的传播行为（PROPAGATION)和隔离级别(Isolation)（终于懂了）</a></li>
<li><a target="_blank" rel="noopener" href="https://ask.dcloud.net.cn/question/8161">mui.ajax() abort</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/bmw601055/article/details/77414855">Uncaught SyntaxError: Unexpected token o</a> </li>
</ul>
<p><em>注：安装测试需要更改application.properties中fastdfs配置以及数据库连接，修改前端app.js配置以及后端新增用户产生二维码的文件目录和文件上传目录</em></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">方陈勇</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://fangchenyong.top/2019/08/23/%E9%A1%B9%E7%9B%AE-%E5%9F%BA%E4%BA%8ENetty+WebSocket%E7%AE%80%E6%98%93%E7%89%88%E5%BE%AE%E4%BF%A1/">https://fangchenyong.top/2019/08/23/%E9%A1%B9%E7%9B%AE-%E5%9F%BA%E4%BA%8ENetty+WebSocket%E7%AE%80%E6%98%93%E7%89%88%E5%BE%AE%E4%BF%A1/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://fangchenyong.top" target="_blank">Joey</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Java/">Java</a><a class="post-meta__tags" href="/tags/SpringBoot/">SpringBoot</a><a class="post-meta__tags" href="/tags/netty/">netty</a></div><div class="post_share"><div class="social-share" data-image="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2019/09/02/%E6%A1%86%E6%9E%B6-Spring/"><img class="prev-cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Spring笔记</div></div></a></div><div class="next-post pull-right"><a href="/2019/08/23/Java-%E6%BA%90%E7%A0%81-JDK8-Object/"><img class="next-cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">JDK8 Object源码</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2019/07/29/项目-理财产品系统/" title="理财产品系统（慕课网）"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-07-29</div><div class="title">理财产品系统（慕课网）</div></div></a></div><div><a href="/2021/04/12/Java-深入理解Java虚拟机/" title="深入理解Java虚拟机"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-04-12</div><div class="title">深入理解Java虚拟机</div></div></a></div><div><a href="/2021/03/20/Java-源码-JDK8-HashMap/" title="JDK8 HashMap源码"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-03-20</div><div class="title">JDK8 HashMap源码</div></div></a></div><div><a href="/2019/09/06/Java-源码-JDK8-String/" title="JDK8 String源码"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-09-06</div><div class="title">JDK8 String源码</div></div></a></div><div><a href="/2019/08/23/Java-源码-JDK8-Object/" title="JDK8 Object源码"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-08-23</div><div class="title">JDK8 Object源码</div></div></a></div><div><a href="/2019/07/20/Java-Java基础笔记/" title="Java基础笔记"><img class="cover" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-07-20</div><div class="title">Java基础笔记</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/3FD9B055-6361-49B7-B8CE-5BA9144BD27F.JPG" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">方陈勇</div><div class="author-info__description">一路向前</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">43</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">51</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">53</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/fangchenyong"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/fangchenyong" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:1013659102@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">个人笔记，如有疑问请联系 QQ:1013659102。</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9F%BA%E4%BA%8ENetty-WebSocket%E7%AE%80%E6%98%93%E7%89%88%E5%BE%AE%E4%BF%A1-%E6%85%95%E8%AF%BE%E7%BD%91"><span class="toc-number">1.</span> <span class="toc-text">基于Netty+WebSocket简易版微信-慕课网</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E6%8A%80%E6%9C%AF%E6%A0%88"><span class="toc-number">1.0.1.</span> <span class="toc-text">1. 技术栈</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E6%95%B0%E6%8D%AE%E5%BA%93%E5%BB%BA%E8%A1%A8"><span class="toc-number">1.0.2.</span> <span class="toc-text">2. 数据库建表</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%A1%A8%EF%BC%9Ausers"><span class="toc-number">1.0.2.1.</span> <span class="toc-text">表：users</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%A1%A8%EF%BC%9Afriends-request"><span class="toc-number">1.0.2.2.</span> <span class="toc-text">表：friends_request</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%A1%A8%EF%BC%9Amy-friends"><span class="toc-number">1.0.2.3.</span> <span class="toc-text">表：my_friends</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%A1%A8%EF%BC%9Achat-msg"><span class="toc-number">1.0.2.4.</span> <span class="toc-text">表：chat_msg</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E8%AE%B0%E5%BD%95"><span class="toc-number">1.0.3.</span> <span class="toc-text">问题解决记录</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/05/06/%E7%AE%97%E6%B3%95-%E6%8F%92%E5%85%A5%E6%8E%92%E5%BA%8F/" title="算法"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="算法"/></a><div class="content"><a class="title" href="/2021/05/06/%E7%AE%97%E6%B3%95-%E6%8F%92%E5%85%A5%E6%8E%92%E5%BA%8F/" title="算法">算法</a><time datetime="2021-05-05T16:00:00.000Z" title="发表于 2021-05-06 00:00:00">2021-05-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/05/06/%E7%AE%97%E6%B3%95-%E9%80%89%E6%8B%A9%E6%8E%92%E5%BA%8F/" title="选择排序"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="选择排序"/></a><div class="content"><a class="title" href="/2021/05/06/%E7%AE%97%E6%B3%95-%E9%80%89%E6%8B%A9%E6%8E%92%E5%BA%8F/" title="选择排序">选择排序</a><time datetime="2021-05-05T16:00:00.000Z" title="发表于 2021-05-06 00:00:00">2021-05-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/04/12/Java-%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3Java%E8%99%9A%E6%8B%9F%E6%9C%BA/" title="深入理解Java虚拟机"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="深入理解Java虚拟机"/></a><div class="content"><a class="title" href="/2021/04/12/Java-%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3Java%E8%99%9A%E6%8B%9F%E6%9C%BA/" title="深入理解Java虚拟机">深入理解Java虚拟机</a><time datetime="2021-04-11T16:00:00.000Z" title="发表于 2021-04-12 00:00:00">2021-04-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/21/%E9%9D%A2%E8%AF%95-%E5%B9%B6%E5%8F%91%E3%80%81%E5%A4%9A%E7%BA%BF%E7%A8%8B/" title="面试题-并发编程"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试题-并发编程"/></a><div class="content"><a class="title" href="/2021/03/21/%E9%9D%A2%E8%AF%95-%E5%B9%B6%E5%8F%91%E3%80%81%E5%A4%9A%E7%BA%BF%E7%A8%8B/" title="面试题-并发编程">面试题-并发编程</a><time datetime="2021-03-20T16:00:00.000Z" title="发表于 2021-03-21 00:00:00">2021-03-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/20/%E9%9D%A2%E8%AF%95-%E9%9B%86%E5%90%88/" title="面试题-集合框架"><img src="https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="面试题-集合框架"/></a><div class="content"><a class="title" href="/2021/03/20/%E9%9D%A2%E8%AF%95-%E9%9B%86%E5%90%88/" title="面试题-集合框架">面试题-集合框架</a><time datetime="2021-03-19T16:00:00.000Z" title="发表于 2021-03-20 00:00:00">2021-03-20</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://fangchenyong.oss-cn-hangzhou.aliyuncs.com/BEF238F4E59CF4D91A694FE9C5DBC030.JPG')"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2021 By 方陈勇</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">人生没有退路！</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script></div></body></html>